<?php 
 require_once('inc_admin.php');
header("Content-type:text/html;charset=utf-8"); 
$link=new ConnDB(DB_CHARSET,DB_HOST,DB_USER,DB_PWD,DB_DBNAME);
 $username=$_POST["username"];
 $pwd=$_POST["password"];

function redirect($url,$str){
       echo $str.'<a href='.$url.'>如果没有跳转，点击跳转</a>';
       header("refresh:3;url=$url");
}
 $sql="select * from admins where adminname='".$username."' and password='".$pwd."'";

 $result=mysql_query($sql) or die('查询失败! '.mysql_error());
 $num=mysql_affected_rows();
 if($num>0){
    redirect('zhongzhuan.html','登陆成功!'); 
}
else{
	redirect('login.html','用户名或密码错误！请重新登录');
}

 ?>
